#ifndef __CN_TCPSERVER_H__
#define __CN_TCPSERVER_H__
#include <string.h>
#include "wm_include.h"
#define     BACKLOG     2       // how many pending connections queue will hold
typedef struct demo_sock_s
{
//    OS_STK *sock_s_task_stk;
    tls_os_queue_t *sock_s_q;
//    OS_STK *sock_rcv_task_stk;
//    OS_STK *sock_snd_task_stk;
    char *sock_rx;
    char *sock_tx;
    bool socket_ok;
    int server_fd;
    int my_port;
    int conn_num;
    int client_fd_queue[BACKLOG];
    u32 rcv_data_len[BACKLOG];
    int if_snd[BACKLOG];
    int all_snd;
	int uart_trans;
	int uart_txlen;
    int snd_data_len[BACKLOG];
} ST_Demo_Sock_S;

extern ST_Demo_Sock_S *cn_socket_server;
int cn_create_socket_server(void);
int cn_socket_send_data(int skt_no, int len, int uart_trans);
#endif
